﻿<%@ Page Language="VB" %>
<%@ Import Namespace="System.Web.Services" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html  >
<head id="Head1" runat="server">
<title>PRBuilder Support Page</title>
        
  <script runat="server">
       <WebMethod> _
        public shared function GetStockQuoteFromPage(symbol As string ) As double
            return 100
        end function
  </script>
  
  <script type="text/javascript">
      function OnLookup() {
          var stb = document.getElementById("_symbolTextBox");
          PageMethods.GetStockQuoteFromPage(stb.value,
                  OnLookupComplete);
      }

      function OnLookupComplete(result) {
          var res = document.getElementById("_resultLabel");
          res.innerHTML = "<b>" + result + "</b>";
      }
  </script>  
</head>
<body>
    <form id="form2" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
        
        </asp:ScriptManager>
    <div>    
    <h1> ASP.NET AJAX Web Services: Web Service Sample Page </h1>
     Enter symbol: 
        <asp:TextBox runat="server" id="_symbolTextBox" />
        <br />
        <input onclick="OnLookup();" id="_lookupButton" 
               type="button" value="Lookup" />
        <br />
        <asp:Label runat="server" id="_resultLabel" />
        
    </div>
    </form>
</body>
</html>